package com.sc.oa.action;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.sc.oa.base.BaseAction;
import com.sc.oa.entity.SysFuntion;

public class FunAction extends BaseAction<SysFuntion>{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8291391236400451113L;
	
	private Integer parentId;
	public String funList(){
		
		List<SysFuntion> fun = (List<SysFuntion>) functionservice.findAll();
		ActionContext.getContext().put("f", fun);
		return "funlist";
	}
	//添加菜单
	public String addFun(){
		functionservice.save(model);
		return "tolist";
	}
	//	编辑菜单
	public String editFun(){
		System.out.println("----->:update");
		functionservice.update(model);
		return "tolist";
	}
	//删除菜单
	public String delFun(){
		Integer id = model.getFunctionId();
		functionservice.deleteByIds(id);
		return "tolist";
	}
	public Integer getParentId() {
		return parentId;
	}
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

}
